package edu.tjufe.llp.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import edu.tjufe.llp.entity.ChargeArea;
import edu.tjufe.llp.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 充电区域Mapper接口
 *
 * @author leiliping
 * @date 2022-12-24
 */
public interface ChargeAreaMapper extends BaseMapper<ChargeArea>
{
    Page<ChargeArea> findPage(Page<ChargeArea> page, @Param("areaName") String areaName);
    /**
     * 查询充电区域
     *
     * @param areaId 充电区域主键
     * @return 充电区域
     */
    public ChargeArea selectChargeAreaByAreaId(Integer areaId);

    /**
     * 查询充电区域列表
     *
     * @param chargeArea 充电区域
     * @return 充电区域集合
     */
    public List<ChargeArea> selectChargeAreaList(ChargeArea chargeArea);

    /**
     * 新增充电区域
     *
     * @param chargeArea 充电区域
     * @return 结果
     */
    public int insertChargeArea(ChargeArea chargeArea);

    /**
     * 修改充电区域
     *
     * @param chargeArea 充电区域
     * @return 结果
     */
    public int updateChargeArea(ChargeArea chargeArea);

    /**
     * 删除充电区域
     *
     * @param areaId 充电区域主键
     * @return 结果
     */
    public int deleteChargeAreaByAreaId(Integer areaId);

    /**
     * 批量删除充电区域
     *
     * @param areaIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteChargeAreaByAreaIds(Integer[] areaIds);

    @Select("select count(*) from charge_area")
    public int selectTotal();
}
